import request from '@/utils/request';
import { ResultAdmin } from './definitions/ResultAdmin';
import { Admin } from './definitions/Admin';
import { Result } from './definitions/Result';
import { ResultIPageAdminResponseEntity } from './definitions/ResultIPageAdminResponseEntity';
import { AdminQueryEntity } from './definitions/AdminQueryEntity';
import { ResultSignInView } from './definitions/ResultSignInView';
import { SignInData } from './definitions/SignInData';


export class AdminController {

    static insertUsingPOSTPath: string = "/v1/admin/admin";
    /// 创建管理后台用户
    async insertUsingPOST(data: Admin, headers?: any):  Promise<ResultAdmin> {
      return request(`/v1/admin/admin`, {
        method: "POST",
        data: JSON.stringify(data) ,
        headers: headers,
      }) as Promise<any>;
    }
    
    static updateUsingPUTPath: string = "/v1/admin/admin";
    /// 修改管理后台用户
    async updateUsingPUT(data: Admin, headers?: any):  Promise<any> {
      return request(`/v1/admin/admin`, {
        method: "PUT",
        data: JSON.stringify(data) ,
        headers: headers,
      }) as Promise<any>;
    }
    
    static getUserInfoUsingGETPath: string = "/v1/admin/admin/getUserInfo";

    async getUserInfoUsingGET( headers?: any) : Promise<ResultAdmin> {
      return request(`/v1/admin/admin/getUserInfo`, {
        method: "GET",
        headers: headers,
      }) as Promise<any>;
    }
    
    static listUsingGETPath: string = "/v1/admin/admin/list";

    async listUsingGET( headers?: any) : Promise<ResultAdmin> {
      return request(`/v1/admin/admin/list`, {
        method: "GET",
        headers: headers,
      }) as Promise<any>;
    }
    
    static logoutUsingPOSTPath: string = "/v1/admin/admin/logout";
    /// logout
    async logoutUsingPOST( headers?: any):  Promise<any> {
      return request(`/v1/admin/admin/logout`, {
        method: "POST",
        data: null ,
        headers: headers,
      }) as Promise<any>;
    }
    
    static pageUsingPOSTPath: string = "/v1/admin/admin/page";
    /// 查询分页
    async pageUsingPOST(data: AdminQueryEntity, headers?: any):  Promise<ResultIPageAdminResponseEntity> {
      return request(`/v1/admin/admin/page`, {
        method: "POST",
        data: JSON.stringify(data) ,
        headers: headers,
      }) as Promise<any>;
    }
    
    static signInUsingPOSTPath: string = "/v1/admin/admin/signIn";
    /// signIn
    async signInUsingPOST(data: SignInData, headers?: any):  Promise<ResultSignInView> {
      return request(`/v1/admin/admin/signIn`, {
        method: "POST",
        data: JSON.stringify(data) ,
        headers: headers,
      }) as Promise<any>;
    }
    
    static getUsingGETPath: string = "/v1/admin/admin/{adminId}";

    async getUsingGET(adminId: string,  headers?: any) : Promise<ResultAdmin> {
      return request(`/v1/admin/admin/${adminId}`, {
        method: "GET",
        headers: headers,
      }) as Promise<any>;
    }
    
    static deleteUsingDELETEPath: string = "/v1/admin/admin/{id}";

    async deleteUsingDELETE(id: string,  headers?: any) : Promise<any> {
      return request(`/v1/admin/admin/${id}`, {
        method: "DELETE",
        headers: headers,
      }) as Promise<any>;
    }
    
}